<!-- 页头 -->
<page-header-wrapper [title]="'运营报表'"></page-header-wrapper>
<nz-card nzTitle="运营报表" [nzExtra]="extraTemplate" acl [acl-ability]="['operationtable-table']">
  <ng-template #extraTemplate>
    <div class="chooseBox">
      <button nz-button nzType="primary" (click)="exportFun()" acl [acl-ability]="['operationtable-export']">导出</button>
      <div class="timeBox">
        <nz-radio-group [(ngModel)]="mode" nzButtonStyle="solid" (ngModelChange)="changeData()">
          <label nz-radio-button nzValue="year">年</label>
          <label nz-radio-button nzValue="month">月</label>
          <label nz-radio-button nzValue="date">日</label>
          <label nz-radio-button nzValue="define">自定义</label>
        </nz-radio-group>
        <div class="dateBox">
          <nz-date-picker [(ngModel)]="date" [nzMode]="mode" [nzFormat]="dateFormat" *ngIf="mode !== 'define'"
            [nzDisabledDate]="disabledDate" (ngModelChange)="onChange($event)"></nz-date-picker>
          <nz-range-picker [(ngModel)]="defineDate" [nzFormat]="dateFormat" *ngIf="mode === 'define'"
            [nzDisabledDate]="disabledDate" (ngModelChange)="onChange($event)"></nz-range-picker>
        </div>

      </div>
    </div>

  </ng-template>
  <st #st multiSort [columns]="columns" [ps]="20" [data]="service.$api_listOperationalReportPage"
    [req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
    [scroll]="{ x: '1200px' }" [res]="{ reName: { list: 'data.records', total: 'data.total' } }"
    [page]="{ show: true, showSize: true, pageSizes: [20, 50, 100] }" [loading]="service.http.loading"></st>
</nz-card>
<nz-card nzTitle="运营报表" [nzExtra]="extraTemplate01" acl [acl-ability]="['operationtable-operationalReport']">
  <ng-template #extraTemplate01>
    <div class="chooseBox">
      <nz-select [(ngModel)]="enterpriseInfoId" style="width: 200px" (ngModelChange)="initPillarData(true)">
        <nz-option [nzValue]="item.value" [nzLabel]="item.label" *ngFor="let item of interManlist"></nz-option>
      </nz-select>
      <div class="timeBox">
        <nz-radio-group [(ngModel)]="modeNext" nzButtonStyle="solid" (ngModelChange)="changeDataNext()">
          <label nz-radio-button nzValue="year">年</label>
          <label nz-radio-button nzValue="month">月</label>
        </nz-radio-group>
        <div class="dateBox">
          <nz-date-picker [nzDisabledDate]="disabledDate" [(ngModel)]="dateNext" [nzMode]="modeNext"
            (ngModelChange)="onChangeNext($event)"></nz-date-picker>
        </div>
      </div>
    </div>
  </ng-template>
  <div nz-row [nzGutter]="64">
    <div nz-col class="gutter-row" [nzSpan]="12">
      <app-operation-curve #curve [chartData]="chartData.lineChart"></app-operation-curve>
    </div>
    <div nz-col class="gutter-row" [nzSpan]="12">
      <app-operation-pillar #pillar [chartData]="chartData.histogram"></app-operation-pillar>
    </div>
  </div>
</nz-card>

<app-opeationtable-pie #pie></app-opeationtable-pie>